package com.base.vm

import androidx.annotation.IdRes
import androidx.annotation.StringRes
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.im.event.SingleLiveEvent

class ImViewModel : ViewModel() {
    private val _statusData = MutableLiveData<Int>()
    val status: LiveData<Int> = _statusData

    fun updateStatus(status: Int) {
        _statusData.postValue(status)
    }

    /**menu*/
    private val _menuCallback = SingleLiveEvent<Int>()
    val menuCallback: LiveData<Int> = _menuCallback

    fun postBottomMenu(@IdRes menuRes: Int) {
        _menuCallback.postValue(menuRes)
    }

    /**title*/
    private val _titleCallback = SingleLiveEvent<Int>()
    val titleCallback: LiveData<Int> = _titleCallback

    fun postTitle(@StringRes title: Int) {
        _titleCallback.postValue(title)
    }
}